<script setup>
/**
 * 在父组件中定义一个person，包括姓名、年龄，将姓名年龄传到子组件，并展示
 */
    import {ref} from 'vue'
    import Son from './Son.vue'

    let refName = ref('')
    let refAge = ref(0)

    let people = {
        name: "张三",
        age: 19
    }

    function fun() {
        refName.value = people.name
        refAge.value = people.age++
    }
</script>

<template>
  <div>
    <Son v-bind:name="refName" :age="refAge"></Son>
    <button v-text="'传输'"  @click="fun()"></button>
  </div>
  
</template>

<style scoped>
</style>